package cn.ruituo.server;

import cn.ruituo.common.User;

import java.beans.XMLEncoder;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
public class InitUser {
    public static void main(String[] args) throws FileNotFoundException {
        List<User> users=new ArrayList<>();
        // D:\Documents\图片和资料\刘邦钊.jpg
        String sss="\u202AD:\\Documents\\图片和资料\\刘邦钊.jpg";
        User user=new User();
        user.setName("admin");
        user.setPass("123");
        user.setRole("admin");
        users.add(user);
        User user2=new User();
        user2.setName("xiaowu");
        user2.setPass("123456");
        user2.setRole("cashier");
        users.add(user2);
        XMLEncoder xe=new XMLEncoder(new FileOutputStream(UserManager.FILENAME));
        xe.writeObject(users);
        xe.close();

    }
}
